package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FitnessknowledgeMapper;
import com.ruoyi.system.domain.Fitnessknowledge;
import com.ruoyi.system.service.IFitnessknowledgeService;

/**
 * 健身知识信息Service业务层处理
 * 
 * @author 张英旺
 * @date 2024-02-28
 */
@Service
public class FitnessknowledgeServiceImpl implements IFitnessknowledgeService 
{
    @Autowired
    private FitnessknowledgeMapper fitnessknowledgeMapper;

    /**
     * 查询健身知识信息
     * 
     * @param knowledgeId 健身知识信息主键
     * @return 健身知识信息
     */
    @Override
    public Fitnessknowledge selectFitnessknowledgeByKnowledgeId(Long knowledgeId)
    {
        return fitnessknowledgeMapper.selectFitnessknowledgeByKnowledgeId(knowledgeId);
    }

    /**
     * 查询健身知识信息列表
     * 
     * @param fitnessknowledge 健身知识信息
     * @return 健身知识信息
     */
    @Override
    public List<Fitnessknowledge> selectFitnessknowledgeList(Fitnessknowledge fitnessknowledge)
    {
        return fitnessknowledgeMapper.selectFitnessknowledgeList(fitnessknowledge);
    }

    /**
     * 新增健身知识信息
     * 
     * @param fitnessknowledge 健身知识信息
     * @return 结果
     */
    @Override
    public int insertFitnessknowledge(Fitnessknowledge fitnessknowledge)
    {
        fitnessknowledge.setCreateTime(DateUtils.getNowDate());
        return fitnessknowledgeMapper.insertFitnessknowledge(fitnessknowledge);
    }

    /**
     * 修改健身知识信息
     * 
     * @param fitnessknowledge 健身知识信息
     * @return 结果
     */
    @Override
    public int updateFitnessknowledge(Fitnessknowledge fitnessknowledge)
    {
        fitnessknowledge.setUpdateTime(DateUtils.getNowDate());
        return fitnessknowledgeMapper.updateFitnessknowledge(fitnessknowledge);
    }

    /**
     * 批量删除健身知识信息
     * 
     * @param knowledgeIds 需要删除的健身知识信息主键
     * @return 结果
     */
    @Override
    public int deleteFitnessknowledgeByKnowledgeIds(Long[] knowledgeIds)
    {
        return fitnessknowledgeMapper.deleteFitnessknowledgeByKnowledgeIds(knowledgeIds);
    }

    /**
     * 删除健身知识信息信息
     * 
     * @param knowledgeId 健身知识信息主键
     * @return 结果
     */
    @Override
    public int deleteFitnessknowledgeByKnowledgeId(Long knowledgeId)
    {
        return fitnessknowledgeMapper.deleteFitnessknowledgeByKnowledgeId(knowledgeId);
    }
}
